﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Demo.Demos.EntityFramework" MasterPageFile="~/Example.Master" %>

<asp:Content runat="server" ContentPlaceHolderID="MainContent">
    <asp:UpdatePanel runat="server">
        <ContentTemplate>
            <d:DataContextControlEntityFramework runat="server">
                <div class="form-horizontal">
                    <fieldset>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                Name</label>
                            <div class="controls">
                                <cwfj:simpleeditor runat="server" datapath="Person.Name" CanBeNull="false" maxlength="20" />
                                (max length is 20, try entering more)
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                Last name</label>
                            <div class="controls">
                                <cwfj:simpleeditor runat="server" datapath="Person.LastName" CanBeNull="false" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                Avatar</label>
                            <div class="controls">
                                <cwfj:fileuploadeditor runat="server" datapath="Avatar" maxnumberoffiles="3" AllowedExtensions=".bpm; .jpg; .jpeg; .gif; .png"  />
                                <cwf:IfElsePanel runat="server" ConditionDataPath="HasAvatar">
                                    <IfTemplate>
                                        <div>
                                        <img src="<%# GetImageUrl(Container) %>" width="150" height="150" class="avatar-image" />
                                        </div>
                                    </IfTemplate>
                                </cwf:IfElsePanel>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                Is Genius</label>
                            <div class="controls">
                                <cwfj:simpleeditor runat="server" datapath="Person.IsGenius" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                IQ</label>
                            <div class="controls">
                                <cwfj:simpleeditor runat="server" datapath="Person.IQ" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                Is visionaire</label>
                            <div class="controls">
                                <cwfj:simpleeditor runat="server" datapath="Person.IsVisionaire" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                Company he worked for</label>
                            <div class="controls">
                                <cwfj:listeditor AutoPostBack="True" runat="server" datapath="CompanyHeWorkedForDropDown" />
                            </div>
                        </div>
                        <cwf:IfElsePanel runat="server" ConditionDataPath="CompanyChosen">
                            <IfTemplate>
                                <div class="control-group">
                                    <label class="control-label" for="focusedInput">
                                        Number of employees</label>
                                    <div class="controls">
                                        <cwf:ModelValue ID="ModelValue1" runat="server" DataPath="Company.NumberOfEmployees" />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="focusedInput">
                                        Description</label>
                                    <div class="controls">
                                        <cwf:ModelValue ID="ModelValue2" runat="server" DataPath="Company.Description" />
                                    </div>
                                </div>
                            </IfTemplate>
                        </cwf:IfElsePanel>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                Email</label>
                            <div class="controls">
                                <cwfj:emaileditor runat="server" datapath="Person.Email" CanBeNull="false"/>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                Password</label>
                            <div class="controls">
                                <cwfj:passwordeditor runat="server" datapath="Person.Password" CanBeNull="false"/>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                Date Of Birth</label>
                            <div class="controls">
                                <cwfj:simpleeditor runat="server" datapath="Person.DateOfBirth" showdate="true" showtime="true" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="focusedInput">
                                Files</label>
                            <div class="controls">
                                <cwfj:fileuploadeditor runat="server" datapath="Files" maxnumberoffiles="3" />
                            </div>
                        </div>
                        <div class="form-actions">
                            <asp:Button runat="server" Text="Save" CssClass="btn btn-primary" ID="Save" OnClick="Click_Save" />
                        </div>
                    </fieldset>
                </div>
            </d:DataContextControlEntityFramework>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
